import {
	post
} from './axios.js';
import store from '../store.js';

//获取我的投稿列表
function getContributeList(p_data, callback) {
	let data = {
		"Token": store.getters.getToken,
		"PageIndex": p_data.PageIndex,
		"PageSize": 20
	};
	post('/content/getworksshareinfolist', data, callback)
}

//保存我的投稿
function saveWorksShareInfo(p_data, callback) {
	let data = {
		"Token": store.getters.getToken,
		"Id": p_data.Id,
		"Title": p_data.Title,
		"PicUrl": p_data.PicUrl,
		"Remark": p_data.Remark,
		"LinkUrl": p_data.LinkUrl,
		"AttaList": p_data.AttaList
	};
	post('/content/saveworksshareinfo', data, callback)
}

//读取我的投稿详情
function getWorksShareInfo(p_data, callback) {
	let data = {
		"Token": store.getters.getToken,
		"Id": p_data.Id,
	};
	post('/content/getworksshareinfo', data, callback)
}

//删除我的投稿
function delWorksShare(p_data, callback) {
	let data = {
		"Token": store.getters.getToken,
		"Id": p_data.Id,
	};
	post('/content/delworksshareinfo', data, callback)
}


export default {
	getContributeList: getContributeList,
	saveWorksShareInfo: saveWorksShareInfo,
	getWorksShareInfo: getWorksShareInfo,
	delWorksShare: delWorksShare,
}
